package thisgame;
import java.net.*;

public class ThisServer {
	public static void main(String args[]) {
		new ThisServer().start();
	}

	private ServerSocket serverSocket;
	private Socket socket;

	public ThisServer() {
		try {
			serverSocket = new ServerSocket(5555);
			System.out.println("서버를 시작했습니다.");
		} catch (Exception e) {
			System.out.println("서버 시작 실패");
		}
	}

	public void start() {
		while (true) {
			try {
				socket = serverSocket.accept();
				System.out.println("소켓을 받아왔습니다.");
				ServerThread serverThread = new ServerThread();
				serverThread.start();
			} catch (Exception e) {
				System.out.println("소켓받기 실패");
			}
		}
	}
}
